package cn.edu.qut.edusys.controller;


import cn.edu.qut.edusys.mapper.RootMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/root")
@ResponseBody
public class rootController {

    @Resource
    private RootMapper rootmapper;

    //完整访问路径； root/root_search
    @RequestMapping("/root_search")
    public List<Map<String,Object>> root_search(@RequestParam Map<String,String> param){
        List<Map<String,Object>> list=null;
        list=rootmapper.root_search(param);
        return list;
    }

    @RequestMapping("/check")
    public List<Map<String,Object>> check(@RequestParam Map<String,String> param){
        List<Map<String,Object>> list;
        //System.out.println(param);
        list=rootmapper.check(param);
        return list;
    }

    @RequestMapping("/edit")
    public int edit(@RequestParam Map<String,String> param){
        int row=0;
        row=rootmapper.update(param);
        return row;
    }


    @RequestMapping("/delete")
    public int batchDelete(String[] ids){
        int row=0;
        row=rootmapper.batchDelete(ids);
        return row;
    }



}
